﻿using System;

import java.util.Scanner;

class QuadraticEquation
{
    private double a, b, c;

    public QuadraticEquation(double a, double b, double c)
    {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    public String solve()
    {
        double delta = b * b - 4 * a * c;
        if (delta > 0)
        {
            double root1 = (-b + Math.sqrt(delta)) / (2 * a);
            double root2 = (-b - Math.sqrt(delta)) / (2 * a);
            return "Two real roots: " + root1 + " and " + root2;
        }
        else if (delta == 0)
        {
            double root = -b / (2 * a);
            return "One real root: " + root;
        }
        else
        {
            return "No real roots";
        }
    }

    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);

        // 让用户输入 a、b 和 c
        System.out.print("Enter the value of a: ");
        double a = scanner.nextDouble();

        System.out.print("Enter the value of b: ");
        double b = scanner.nextDouble();

        System.out.print("Enter the value of c: ");
        double c = scanner.nextDouble();

        // 创建 QuadraticEquation 对象并求解
        QuadraticEquation equation = new QuadraticEquation(a, b, c);
        System.out.println(equation.solve());

        scanner.close();
    }
}